<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>对象的扩展</title>
    <script>
       let user = {
           id:10086,
           name:"刘德华",
           age:50
       }

       //得到的都是数组
       let keys = Object.keys(user);

       console.log(user.id);

       //对象的属性的值获取时，如果属性名称是变量一定要把属性用中括号抱起来
       keys.forEach(key=>{
           console.log(key+":"+user[key])
       })

    </script>
</head>
<body>

</body>
</html>